package m202406.d06;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @@author: 爱做梦的锤子
 * @date: 2024/6/6 22:21
 */
public class OD_T02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int[] array = Arrays.stream(scanner.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        Arrays.sort(array);
        int sum = Arrays.stream(array).sum();

        int sum1 = 0;
        int sum2 = 0;
        for (int i = 0; i < array.length; i++) {
            if (sum1 < sum2) {
                sum1 = sum1 + array[i];
            } else {
                sum2 = sum2 + array[i];
            }
        }
        System.out.println(Math.abs(sum1 - sum2));
    }
}
